#
# Note that the OTB/CMakeLists.txt file configures this file
#
#               CMake/CTestCustom.cmake.in
#
# to this file
#
#       ${OTB_BINARY_DIR}/CTestCustom.cmake
#
#----------------------------------------------------------------------
#
# For further details regarding this file,
# see http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
#
# and
# http://www.kitware.com/blog/home/post/27
#
#----------------------------------------------------------------------

set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)


set(CTEST_CUSTOM_COVERAGE_EXCLUDE
 ${CTEST_CUSTOM_COVERAGE_EXCLUDE}

 # Exclude try_compile sources from coverage results:
 "/CMakeFiles/CMakeTmp/"

 # Exclude files from the Examples directories
 #".*/Examples/.*"

 # Exclude files from the ThirdParty Utilities directories
 ".*/Modules/ThirdParty/.*"
 ".*/Utilities/.*"

 # Exclude SWIG wrappers files
 ".*/Modules/Wrappers/SWIG/src/otbApplicationPYTHON_wrap.*"
 ".*/Modules/Wrappers/SWIG/src/otbApplicationJAVA_wrap.*"

 # Exclude Qt moc file
 ".*moc_.*"
 )

set(CTEST_CUSTOM_WARNING_EXCEPTION
  ${CTEST_CUSTOM_WARNING_EXCEPTION}
  "vcl_deprecated_header"
  "backward_warning"
  "warning LNK4221"
  "ranlib:.*file:.*has no symbols"
  "ranlib: file: .+ has no symbols"
  "ranlib:.*warning for library:.*the table of contents is empty.*no object file members in the library define global symbols.*"
  "libtool:.*file:.*has no symbols"
  "warning -.: directory name .* does not exist"
  "ld.*warning.*duplicate dylib.*"
  "WARNING non-zero return value in ctest"
  ".*Microsoft.*include.*.h.*[Ww]arning.*"
  ".*gdal_priv.h.*[Ww]arning.*"
  ".*cpl_string.h.*[Ww]arning.*"
  ".*ogr_feature.h.*[Ww]arning.*"

  # Ignore clang's summary warning, assuming prior text has matched some
  # other warning expression:
  "[0-9,]+ warnings? generated."

  )
